package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ComboMapper;
import com.ruoyi.system.domain.Combo;
import com.ruoyi.system.service.IComboService;

/**
 * 套餐Service业务层处理
 * 
 * @author Eugene
 * @date 2023-04-19
 */
@Service
public class ComboServiceImpl implements IComboService 
{
    @Autowired
    private ComboMapper comboMapper;

    /**
     * 查询套餐
     * 
     * @param id 套餐主键
     * @return 套餐
     */
    @Override
    public Combo selectComboById(Long id)
    {
        return comboMapper.selectComboById(id);
    }

    /**
     * 查询套餐列表
     * 
     * @param combo 套餐
     * @return 套餐
     */
    @Override
    public List<Combo> selectComboList(Combo combo)
    {
        return comboMapper.selectComboList(combo);
    }

    /**
     * 新增套餐
     * 
     * @param combo 套餐
     * @return 结果
     */
    @Override
    public int insertCombo(Combo combo)
    {
        combo.setCreateTime(DateUtils.getNowDate());
        return comboMapper.insertCombo(combo);
    }

    /**
     * 修改套餐
     * 
     * @param combo 套餐
     * @return 结果
     */
    @Override
    public int updateCombo(Combo combo)
    {
        combo.setUpdateTime(DateUtils.getNowDate());
        return comboMapper.updateCombo(combo);
    }

    /**
     * 批量删除套餐
     * 
     * @param ids 需要删除的套餐主键
     * @return 结果
     */
    @Override
    public int deleteComboByIds(Long[] ids)
    {
        return comboMapper.deleteComboByIds(ids);
    }

    /**
     * 删除套餐信息
     * 
     * @param id 套餐主键
     * @return 结果
     */
    @Override
    public int deleteComboById(Long id)
    {
        return comboMapper.deleteComboById(id);
    }
}
